Bug 577239

Summary: Reduce memory usage of ScriptItemize
Product: [Eclipse Project] Platform Reporter: Jonah Graham <jonah>
Component: SWTAssignee: Platform-SWT-Inbox <platform-swt-inbox>
Status: NEW --- QA Contact:
Severity: normal    
Priority: P3    
Version: 4.22   
Target Milestone: ---   
Hardware: PC   
OS: Windows 10   
Whiteboard:
Bug Depends on:    
Bug Blocks: 577238    

Description Jonah Graham CLA 2021-11-12 19:39:58 EST
Calls to ScriptItemize allocates huge buffers to accommodate for worst case ScriptItemize results all the time.

The design of ScriptItemize is that a "typical" sized buffer is used, and if ScriptItemize returns E_OUTOFMEMORY then the buffer size is increased.

At the moment the size of the buffer is the length of the string (+2) x sizeof SCRIPT_ITEM (which is 8 bytes).