Skip to content

Commit

Permalink
Adding parsing of image parameters from PList
Browse files Browse the repository at this point in the history
  • Loading branch information
tesonep committed Jul 3, 2023
1 parent 3ba4268 commit 27255c9
Showing 1 changed file with 21 additions and 2 deletions.
23 changes: 21 additions & 2 deletions src/parameters/parameters.m
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
#import <Foundation/Foundation.h>
#include "pharovm/pharo.h"
#include "pharovm/parameters/parameters.h"
#include "pharovm/parameters/parameterVector.h"
#include "pharovm/debug.h"
#include "pharovm/pathUtilities.h"

Expand Down Expand Up @@ -28,7 +29,7 @@
CFNumberRef maxOldSpaceSizeRef;
CFNumberRef edenSizeRef;
CFNumberRef codeSizeRef;

CFArrayRef argumentsRef;


mainBundle = CFBundleGetMainBundle();
Expand Down Expand Up @@ -84,7 +85,6 @@
parameters->isWorker = !CFBooleanGetValue(workerRef);
}


maxFramesToLogRef = CFBundleGetValueForInfoDictionaryKey(mainBundle, CFSTR("PharoMaxFramesToLog"));

if(maxFramesToLogRef != NULL){
Expand All @@ -109,4 +109,23 @@
CFNumberGetValue(codeSizeRef, kCFNumberSInt64Type, &parameters->maxCodeSize);
}


argumentsRef = CFBundleGetValueForInfoDictionaryKey(mainBundle, CFSTR("PharoImageParameters"));

if(argumentsRef != NULL){
CFIndex count = CFArrayGetCount(argumentsRef);

for(CFIndex i=0; i < count; i++){
CFStringRef value = CFArrayGetValueAtIndex(argumentsRef, i);

if(value != NULL){
char* valueString = calloc(1, 255+1);

CFStringGetCString(value, valueString, 255 + 1, kCFStringEncodingUTF8);
vm_parameter_vector_insert_from(&parameters->imageParameters, 1, &valueString);
}

}
}

}

0 comments on commit 27255c9

Please sign in to comment.