🎉 Celebrating 25 Years of GameDev.net! 🎉

Not many can claim 25 years on the Internet! Join us in celebrating this milestone. Learn more about our history, and thank you for being a part of our community!

AddScriptSection version that doesn't copy the string

Started by
0 comments, last by WitchLord 19 years, 4 months ago
Is it possible to have a variant of asIScriptEngine::AddScriptSection (maybe AddScriptSectionPointer) that doesn't do a copy of the code string? Since all my calling code already keep the original source memory alive (for other domestic purposes) it is a waste of time and space to make another copy. With this new call it is the caller responsability to keep the memory allocated during module lifetime. Thanks Licu
Advertisement
After the Build() method completes the code strings are freed, so the extra memory allocations are only temporary.

I could make the AddScriptSection() method take an extra method to tell the library that the application will be responsible for holding the memory. Thanks for the suggestion.

AngelCode.com - game development and more - Reference DB - game developer references
AngelScript - free scripting library - BMFont - free bitmap font generator - Tower - free puzzle game

This topic is closed to new replies.

Advertisement