Re: [master 2/2] memory: check for URL install in loader too (#596993).

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 06/01/2010 03:13 PM, Hans de Goede wrote:
-static void checkForRam(void) {
- if (totalMemory()< MIN_RAM) {
+static void checkForRam(int install_method) {
+ char reason_no[] = "";
+ char reason_method[] = " using this install method";
 > + char *reason = reason_no;

It would better to use:

const char *reason_no = "";
const char *reason_method = " using this install method";
const char *reason = reason_no;


When you write:
char reason_method[] = " using this install method";

You are asking the compiler to create a const string
" using this install method" in the constant segment, and
to allocate an array on the stack large enough to hold this
string, and upon entering of the function to copy the contents
of the const string to the array on the stack. It would be
better (more efficient) to just pass a pointer around.


Thanks for the explanation. Fixed and pushed.

Ales

_______________________________________________
Anaconda-devel-list mailing list
Anaconda-devel-list@xxxxxxxxxx
https://www.redhat.com/mailman/listinfo/anaconda-devel-list


[Index of Archives]     [Kickstart]     [Fedora Users]     [Fedora Legacy List]     [Fedora Maintainers]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [Yosemite Photos]     [KDE Users]     [Fedora Tools]
  Powered by Linux