Memory workaround
This commit is contained in:
@@ -164,8 +164,8 @@ namespace lime {
|
||||
|
||||
} else {
|
||||
|
||||
bytes = Bytes();
|
||||
bytes.Set(data);
|
||||
bytes = Bytes ();
|
||||
bytes.Set (data);
|
||||
resource = Resource (&bytes);
|
||||
|
||||
}
|
||||
@@ -918,7 +918,8 @@ namespace lime {
|
||||
|
||||
ImageBuffer imageBuffer;
|
||||
|
||||
Bytes bytes (data);
|
||||
Bytes bytes;
|
||||
bytes.Set (data);
|
||||
Resource resource = Resource (&bytes);
|
||||
|
||||
#ifdef LIME_JPEG
|
||||
@@ -963,7 +964,8 @@ namespace lime {
|
||||
value lime_lzma_decode (value buffer) {
|
||||
|
||||
#ifdef LIME_LZMA
|
||||
Bytes data = Bytes (buffer);
|
||||
Bytes data;
|
||||
data.Set (buffer);
|
||||
Bytes result;
|
||||
|
||||
LZMA::Decode (&data, &result);
|
||||
@@ -979,7 +981,8 @@ namespace lime {
|
||||
value lime_lzma_encode (value buffer) {
|
||||
|
||||
#ifdef LIME_LZMA
|
||||
Bytes data = Bytes (buffer);
|
||||
Bytes data;
|
||||
data.Set (buffer);
|
||||
Bytes result;
|
||||
|
||||
LZMA::Encode (&data, &result);
|
||||
@@ -1284,7 +1287,8 @@ namespace lime {
|
||||
|
||||
TextLayout *text = (TextLayout*)val_data (textHandle);
|
||||
Font *font = (Font*)val_data (fontHandle);
|
||||
Bytes bytes = Bytes (data);
|
||||
Bytes bytes;
|
||||
bytes.Set (data);
|
||||
text->Position (font, size, textString.__s, &bytes);
|
||||
return bytes.Value ();
|
||||
|
||||
|
||||
@@ -17,7 +17,8 @@ namespace lime {
|
||||
|
||||
void lime_al_buffer_data (int buffer, int format, value data, int size, int freq) {
|
||||
|
||||
Bytes bytes (data);
|
||||
Bytes bytes;
|
||||
bytes.Set (data);
|
||||
alBufferData (buffer, format, bytes.Data (), size, freq);
|
||||
|
||||
}
|
||||
|
||||
@@ -165,7 +165,8 @@ namespace lime {
|
||||
|
||||
if (len == 0) return;
|
||||
|
||||
Bytes bytes (inByteBuffer);
|
||||
Bytes bytes;
|
||||
bytes.Set (inByteBuffer);
|
||||
const unsigned char *data = bytes.Data ();
|
||||
int size = bytes.Length ();
|
||||
|
||||
@@ -184,8 +185,8 @@ namespace lime {
|
||||
|
||||
if (len == 0) return;
|
||||
|
||||
Bytes bytes (inByteBuffer);
|
||||
|
||||
Bytes bytes;
|
||||
bytes.Set (inByteBuffer);
|
||||
const unsigned char *data = bytes.Data ();
|
||||
int size = bytes.Length ();
|
||||
|
||||
@@ -258,7 +259,8 @@ namespace lime {
|
||||
unsigned char *data = 0;
|
||||
int size = 0;
|
||||
|
||||
Bytes bytes (buffer);
|
||||
Bytes bytes;
|
||||
bytes.Set (buffer);
|
||||
|
||||
if (bytes.Length ()) {
|
||||
|
||||
@@ -277,7 +279,8 @@ namespace lime {
|
||||
unsigned char *data = 0;
|
||||
int size = 0;
|
||||
|
||||
Bytes bytes (buffer);
|
||||
Bytes bytes;
|
||||
bytes.Set (buffer);
|
||||
|
||||
if (bytes.Length ()) {
|
||||
|
||||
@@ -1203,7 +1206,8 @@ namespace lime {
|
||||
void lime_gl_read_pixels (int x, int y, int width, int height, int format, int type, value buffer, int offset) {
|
||||
|
||||
unsigned char *data = 0;
|
||||
Bytes bytes (buffer);
|
||||
Bytes bytes;
|
||||
bytes.Set (buffer);
|
||||
|
||||
if (bytes.Length ()) {
|
||||
|
||||
@@ -1290,7 +1294,8 @@ namespace lime {
|
||||
|
||||
unsigned char *data = 0;
|
||||
|
||||
Bytes bytes (buffer);
|
||||
Bytes bytes;
|
||||
bytes.Set (buffer);
|
||||
|
||||
if (bytes.Length ()) {
|
||||
|
||||
@@ -1320,7 +1325,8 @@ namespace lime {
|
||||
void lime_gl_tex_sub_image_2d (int target, int level, int xOffset, int yOffset, int width, int height, int format, int type, value buffer, int offset) {
|
||||
|
||||
unsigned char *data = 0;
|
||||
Bytes bytes (buffer);
|
||||
Bytes bytes;
|
||||
bytes.Set (buffer);
|
||||
|
||||
if (bytes.Length ()) {
|
||||
|
||||
@@ -1335,7 +1341,8 @@ namespace lime {
|
||||
|
||||
void lime_gl_uniform_matrix (int loc, bool trans, value inBytes, int count) {
|
||||
|
||||
Bytes bytes (inBytes);
|
||||
Bytes bytes;
|
||||
bytes.Set (inBytes);
|
||||
int size = bytes.Length ();
|
||||
const float *data = (float *)bytes.Data ();
|
||||
int nbElems = size / sizeof (float);
|
||||
@@ -1360,7 +1367,8 @@ namespace lime {
|
||||
|
||||
void lime_gl_uniform1fv (int loc, value inByteBuffer) {
|
||||
|
||||
Bytes bytes (inByteBuffer);
|
||||
Bytes bytes;
|
||||
bytes.Set (inByteBuffer);
|
||||
int size = bytes.Length ();
|
||||
const float *data = (float *)bytes.Data ();
|
||||
int nbElems = size / sizeof (float);
|
||||
@@ -1379,7 +1387,8 @@ namespace lime {
|
||||
|
||||
void lime_gl_uniform1iv (int loc, value inByteBuffer) {
|
||||
|
||||
Bytes bytes (inByteBuffer);
|
||||
Bytes bytes;
|
||||
bytes.Set (inByteBuffer);
|
||||
int size = bytes.Length ();
|
||||
const int *data = (int *)bytes.Data ();
|
||||
int nbElems = size / sizeof (int);
|
||||
|
||||
@@ -38,7 +38,8 @@ namespace lime {
|
||||
}
|
||||
|
||||
value buffer_value = val_field (colorMatrix, id_buffer);
|
||||
Bytes bytes = Bytes (buffer_value);
|
||||
Bytes bytes;
|
||||
bytes.Set (buffer_value);
|
||||
float* src = (float*)bytes.Data ();
|
||||
|
||||
for (int i = 0; i < 20; i++) {
|
||||
|
||||
@@ -188,7 +188,8 @@ namespace lime {
|
||||
AutoGCRoot* callback = (AutoGCRoot*)userp;
|
||||
|
||||
size_t length = size * nmemb;
|
||||
Bytes bytes = Bytes (val_call1 (callback->get (), alloc_int (length)));
|
||||
Bytes bytes;
|
||||
bytes.Set (val_call1 (callback->get (), alloc_int (length)));
|
||||
|
||||
if (bytes.Length () <= length) length = bytes.Length ();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user