Changeset 3171:60fe63609b52
- Timestamp:
- 02/26/07 19:55:07 (6 years ago)
- Branch:
- default
- File:
-
- 1 edited
-
sage/libs/ntl/ntl_wrap.cc (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
sage/libs/ntl/ntl_wrap.cc
r2902 r3171 328 328 { 329 329 unsigned char stack_bytes[4096]; 330 int use_ stack;330 int use_heap; 331 331 const ZZ& z = coeff(*x, i); 332 332 unsigned long size = NumBytes(z); 333 use_ stack= (size > sizeof(stack_bytes));334 unsigned char* bytes = use_ stack? (unsigned char*) malloc(size) : stack_bytes;333 use_heap = (size > sizeof(stack_bytes)); 334 unsigned char* bytes = use_heap ? (unsigned char*) malloc(size) : stack_bytes; 335 335 BytesFromZZ(bytes, z, size); 336 336 mpz_import(*output, size, -1, 1, 0, 0, bytes); 337 337 if (sign(z) < 0) 338 338 mpz_neg(*output, *output); 339 if (use_ stack)339 if (use_heap) 340 340 free(bytes); 341 341 }
Note: See TracChangeset
for help on using the changeset viewer.
