Changeset 300
- Timestamp:
- 04/22/08 20:27:25 (9 months ago)
- Files:
-
- trunk/ddl/FileBuffer.d (modified) (1 diff)
- trunk/ddl/omf/OMFLoader.d (modified) (2 diffs)
- trunk/ddl/omf/OMFModule.d (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/ddl/FileBuffer.d
r287 r300 67 67 (new File(this.path)).write(this.data); 68 68 } 69 70 void deleteData() { 71 delete this.data; 72 } 69 73 } trunk/ddl/omf/OMFLoader.d
r287 r300 55 55 public DynamicLibrary load(LoaderRegistry registry,FileBuffer file){ 56 56 debug debugLog("loading OMF library"); 57 return new OMFLibrary(file); 57 auto res = new OMFLibrary(file); 58 file.deleteData(); 59 return res; 58 60 } 59 61 } … … 80 82 OMFLibrary lib = new OMFLibrary(); 81 83 OMFModule mod = new OMFModule(file); 84 file.deleteData(); 85 82 86 lib.addModule(mod); 83 87 trunk/ddl/omf/OMFModule.d
r299 r300 203 203 204 204 //TODO: alter this to zero in on D namespaces and C/asm namespaces 205 this.moduleName = binary.libraryName ;205 this.moduleName = binary.libraryName.dup; 206 206 this.moduleName = Text.replace(this.moduleName,'\\','.'); 207 207 //debug debugLog(moduleName); … … 469 469 } 470 470 471 // Pack all symbol names together into a new buffer 472 473 char[] symNamesBuffer; 474 size_t totalSymNameLength = 0; 475 foreach (sym; symbols) { 476 totalSymNameLength += sym.name.length; 477 } 478 479 symNamesBuffer.length = totalSymNameLength; 480 size_t curSymNameLength = 0; 481 foreach (ref sym; symbols) { 482 char[] name2 = symNamesBuffer[curSymNameLength .. curSymNameLength + sym.name.length]; 483 curSymNameLength += sym.name.length; 484 name2[] = sym.name[]; 485 sym.name = name2; 486 } 487 471 488 //printf("%.*s"\n, toString); 472 489 }
